Platform Explorer / Nuxeo Platform 2021.25

Component org.nuxeo.ecm.diff.service.DiffDisplayService

Documentation

This service provides an extension point to manage document diff display.

Antoine Taillefer

Resolution Order

160
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

801
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.ecm.diff.service.impl.DiffDisplayServiceImpl

Services

Extension Points

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.diff.service.DiffDisplayService">

  <documentation>
    This service provides an extension point to manage
    document diff display.

    @author
    Antoine Taillefer
  </documentation>

  <implementation class="org.nuxeo.ecm.diff.service.impl.DiffDisplayServiceImpl" />

  <service>
    <provide interface="org.nuxeo.ecm.diff.service.DiffDisplayService" />
  </service>

  <extension-point name="diffDefaultDisplay">

    <documentation>
      <pre>
        The diffDefaultDisplay extension point allows you to
        contribute a diffExcludedFields contribution to define a
        set of
        fields from a given schema that will be
        excluded from the default
        diff display in the document diff view
        (the default diff display
        takes into account every different field of every common schema
        between the compared
        documents, in an undefined order).

        If no
        fields are specified, the whole schema is excluded.
      </pre>
      <code>
        <diffExcludedFields schema="common" />
        <diffExcludedFields schema="dublincore">
          <fields>
            <field name="subjects" />
            <field name="modified" />
          </fields>
        </diffExcludedFields>
      </code>
    </documentation>
    <object class="org.nuxeo.ecm.diff.service.impl.DiffExcludedFieldsDescriptor" />

    <documentation>
      <pre>
        The diffDefaultDisplay extension point also allows you to
        contribute a diffComplexField contribution to define
        a set of
        items from a given complex property that will be
        included or
        excluded from the default
        diff display in the
        document diff view.
        Order matters for included items.
      </pre>
      <code>
        <diffComplexField schema="complextypes" name="complex">
          <includedItems>
            <item name="dateItem" />
            <item name="stringItem" />
          </includedItems>
        </diffComplexField>

        <diffComplexField schema="complextypes" name="complexList">
          <excludedItems>
            <item name="stringItem" />
            <item name="dateItem" />
          </excludedItems>
        </diffComplexField>
      </code>
    </documentation>
    <object class="org.nuxeo.ecm.diff.service.impl.DiffComplexFieldDescriptor" />

  </extension-point>


  <extension-point name="diffDisplay">
    <documentation>

      <pre>
        A diffDisplay contribution defines which diffBlocks will be
        displayed in the document diff view for a given
        document type.
        The order matters.

        If the 2 diffed documents have the same type,
        the diffDisplay matching this type
        is used, otherwise or if such
        a diffDisplay does not exist, the default diff display is used.
        The default diff
        display
        takes into account every different field
        of every common schema between the
        compared documents, in an
        undefined order.
      </pre>

      <code>
        <diffDisplay type="File">
          <diffBlocks>
            <diffBlock name="dublincore" />
            <diffBlock name="files" />
          </diffBlocks>
        </diffDisplay>
        <diffDisplay type="Note" enabled="false" />
      </code>

    </documentation>
    <object class="org.nuxeo.ecm.diff.service.impl.DiffDisplayDescriptor" />
  </extension-point>

  <extension-point name="diffBlock">
    <documentation>

      <pre>
        A diffBlock contribution defines which fields will be
        displayed in the diff display block.
        The order matters.

        For
        complex types, items can be
        defined to specifiy which sub-fields
        must be displayed and in which order.
      </pre>

      <code>
        <diffBlock name="dublincore" label="label.diffBlock.dublincore">
          <fields>
            <field schema="dublincore" name="description" />
            <field schema="dublincore" name="coverage" />
            <field schema="dublincore" name="created" />
            <field schema="dublincore" name="modified" />
          </fields>
        </diffBlock>
        <diffBlock name="files" label="label.diffBlock.files">
          <fields>
            <field schema="file" name="content" displayContentDiffLinks="true" />
            <field schema="files" name="files">
              <items>
                <!-- Display the file only, not the filename which is managed by the file widget type -->
                <item name="file" displayContentDiffLinks="true" />
              </items>
            </field>
          </fields>
        </diffBlock>
      </code>

    </documentation>
    <object class="org.nuxeo.ecm.diff.service.impl.DiffBlockDescriptor" />
  </extension-point>

</component>